{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>adjcp</th>\n",
       "      <th>tic</th>\n",
       "      <th>zopen</th>\n",
       "      <th>zhigh</th>\n",
       "      <th>zlow</th>\n",
       "      <th>zadjcp</th>\n",
       "      <th>zclose</th>\n",
       "      <th>zd_5</th>\n",
       "      <th>zd_10</th>\n",
       "      <th>zd_15</th>\n",
       "      <th>zd_20</th>\n",
       "      <th>zd_25</th>\n",
       "      <th>zd_30</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2021-01-04</td>\n",
       "      <td>133.520004</td>\n",
       "      <td>133.610001</td>\n",
       "      <td>126.760002</td>\n",
       "      <td>129.410004</td>\n",
       "      <td>128.453430</td>\n",
       "      <td>AAPL</td>\n",
       "      <td>0.031760</td>\n",
       "      <td>0.032455</td>\n",
       "      <td>-0.020478</td>\n",
       "      <td>-0.007392</td>\n",
       "      <td>-0.024719</td>\n",
       "      <td>0.031420</td>\n",
       "      <td>0.017758</td>\n",
       "      <td>0.002323</td>\n",
       "      <td>-0.010486</td>\n",
       "      <td>-0.021578</td>\n",
       "      <td>-0.034987</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2021-01-04</td>\n",
       "      <td>231.250000</td>\n",
       "      <td>231.250000</td>\n",
       "      <td>223.669998</td>\n",
       "      <td>226.660004</td>\n",
       "      <td>217.989258</td>\n",
       "      <td>AMGN</td>\n",
       "      <td>0.020251</td>\n",
       "      <td>0.020251</td>\n",
       "      <td>-0.013192</td>\n",
       "      <td>-0.038254</td>\n",
       "      <td>-0.014179</td>\n",
       "      <td>0.000856</td>\n",
       "      <td>-0.004266</td>\n",
       "      <td>0.001206</td>\n",
       "      <td>0.002958</td>\n",
       "      <td>0.000972</td>\n",
       "      <td>-0.002494</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2021-01-04</td>\n",
       "      <td>121.300003</td>\n",
       "      <td>121.800003</td>\n",
       "      <td>116.849998</td>\n",
       "      <td>118.040001</td>\n",
       "      <td>116.058220</td>\n",
       "      <td>AXP</td>\n",
       "      <td>0.027618</td>\n",
       "      <td>0.031854</td>\n",
       "      <td>-0.010081</td>\n",
       "      <td>-0.016789</td>\n",
       "      <td>-0.023737</td>\n",
       "      <td>0.007930</td>\n",
       "      <td>-0.002330</td>\n",
       "      <td>0.000971</td>\n",
       "      <td>0.011670</td>\n",
       "      <td>0.014202</td>\n",
       "      <td>0.010022</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2021-01-04</td>\n",
       "      <td>210.000000</td>\n",
       "      <td>210.199997</td>\n",
       "      <td>202.490005</td>\n",
       "      <td>202.720001</td>\n",
       "      <td>202.720001</td>\n",
       "      <td>BA</td>\n",
       "      <td>0.035912</td>\n",
       "      <td>0.036898</td>\n",
       "      <td>-0.001135</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.052976</td>\n",
       "      <td>0.051490</td>\n",
       "      <td>0.065741</td>\n",
       "      <td>0.083935</td>\n",
       "      <td>0.102499</td>\n",
       "      <td>0.099298</td>\n",
       "      <td>0.089213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2021-01-04</td>\n",
       "      <td>183.000000</td>\n",
       "      <td>185.979996</td>\n",
       "      <td>180.250000</td>\n",
       "      <td>182.149994</td>\n",
       "      <td>176.713684</td>\n",
       "      <td>CAT</td>\n",
       "      <td>0.004667</td>\n",
       "      <td>0.021027</td>\n",
       "      <td>-0.010431</td>\n",
       "      <td>-0.029845</td>\n",
       "      <td>0.000714</td>\n",
       "      <td>-0.012649</td>\n",
       "      <td>-0.014598</td>\n",
       "      <td>-0.014490</td>\n",
       "      <td>-0.014181</td>\n",
       "      <td>-0.020199</td>\n",
       "      <td>-0.024026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>251</th>\n",
       "      <td>2021-12-31</td>\n",
       "      <td>504.140015</td>\n",
       "      <td>506.869995</td>\n",
       "      <td>502.040009</td>\n",
       "      <td>502.140015</td>\n",
       "      <td>500.658447</td>\n",
       "      <td>UNH</td>\n",
       "      <td>0.003983</td>\n",
       "      <td>0.009420</td>\n",
       "      <td>-0.000199</td>\n",
       "      <td>-0.002951</td>\n",
       "      <td>-0.004540</td>\n",
       "      <td>0.001549</td>\n",
       "      <td>-0.011798</td>\n",
       "      <td>-0.019499</td>\n",
       "      <td>-0.033978</td>\n",
       "      <td>-0.050399</td>\n",
       "      <td>-0.061491</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>251</th>\n",
       "      <td>2021-12-31</td>\n",
       "      <td>216.809998</td>\n",
       "      <td>217.979996</td>\n",
       "      <td>215.490005</td>\n",
       "      <td>216.710007</td>\n",
       "      <td>216.358002</td>\n",
       "      <td>V</td>\n",
       "      <td>0.000461</td>\n",
       "      <td>0.005860</td>\n",
       "      <td>-0.005630</td>\n",
       "      <td>-0.001624</td>\n",
       "      <td>-0.005324</td>\n",
       "      <td>0.004504</td>\n",
       "      <td>-0.003733</td>\n",
       "      <td>-0.009401</td>\n",
       "      <td>-0.020156</td>\n",
       "      <td>-0.035947</td>\n",
       "      <td>-0.042575</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>251</th>\n",
       "      <td>2021-12-31</td>\n",
       "      <td>52.200001</td>\n",
       "      <td>52.310001</td>\n",
       "      <td>51.880001</td>\n",
       "      <td>51.959999</td>\n",
       "      <td>50.723785</td>\n",
       "      <td>VZ</td>\n",
       "      <td>0.004619</td>\n",
       "      <td>0.006736</td>\n",
       "      <td>-0.001540</td>\n",
       "      <td>-0.023792</td>\n",
       "      <td>-0.005550</td>\n",
       "      <td>0.008353</td>\n",
       "      <td>0.013203</td>\n",
       "      <td>0.001899</td>\n",
       "      <td>-0.004224</td>\n",
       "      <td>-0.007667</td>\n",
       "      <td>-0.008154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>251</th>\n",
       "      <td>2021-12-31</td>\n",
       "      <td>51.900002</td>\n",
       "      <td>52.419998</td>\n",
       "      <td>51.830002</td>\n",
       "      <td>52.160000</td>\n",
       "      <td>51.639271</td>\n",
       "      <td>WBA</td>\n",
       "      <td>-0.004985</td>\n",
       "      <td>0.004985</td>\n",
       "      <td>-0.006327</td>\n",
       "      <td>-0.009983</td>\n",
       "      <td>0.003270</td>\n",
       "      <td>-0.008589</td>\n",
       "      <td>-0.027818</td>\n",
       "      <td>-0.036337</td>\n",
       "      <td>-0.046492</td>\n",
       "      <td>-0.064555</td>\n",
       "      <td>-0.069562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>251</th>\n",
       "      <td>2021-12-31</td>\n",
       "      <td>143.199997</td>\n",
       "      <td>145.039993</td>\n",
       "      <td>142.919998</td>\n",
       "      <td>144.690002</td>\n",
       "      <td>144.132538</td>\n",
       "      <td>WMT</td>\n",
       "      <td>-0.010298</td>\n",
       "      <td>0.002419</td>\n",
       "      <td>-0.012233</td>\n",
       "      <td>-0.003853</td>\n",
       "      <td>0.010617</td>\n",
       "      <td>-0.012910</td>\n",
       "      <td>-0.024832</td>\n",
       "      <td>-0.018767</td>\n",
       "      <td>-0.026154</td>\n",
       "      <td>-0.027970</td>\n",
       "      <td>-0.024153</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7308 rows × 18 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           date        open        high         low       close       adjcp  \\\n",
       "0    2021-01-04  133.520004  133.610001  126.760002  129.410004  128.453430   \n",
       "0    2021-01-04  231.250000  231.250000  223.669998  226.660004  217.989258   \n",
       "0    2021-01-04  121.300003  121.800003  116.849998  118.040001  116.058220   \n",
       "0    2021-01-04  210.000000  210.199997  202.490005  202.720001  202.720001   \n",
       "0    2021-01-04  183.000000  185.979996  180.250000  182.149994  176.713684   \n",
       "..          ...         ...         ...         ...         ...         ...   \n",
       "251  2021-12-31  504.140015  506.869995  502.040009  502.140015  500.658447   \n",
       "251  2021-12-31  216.809998  217.979996  215.490005  216.710007  216.358002   \n",
       "251  2021-12-31   52.200001   52.310001   51.880001   51.959999   50.723785   \n",
       "251  2021-12-31   51.900002   52.419998   51.830002   52.160000   51.639271   \n",
       "251  2021-12-31  143.199997  145.039993  142.919998  144.690002  144.132538   \n",
       "\n",
       "      tic     zopen     zhigh      zlow    zadjcp    zclose      zd_5  \\\n",
       "0    AAPL  0.031760  0.032455 -0.020478 -0.007392 -0.024719  0.031420   \n",
       "0    AMGN  0.020251  0.020251 -0.013192 -0.038254 -0.014179  0.000856   \n",
       "0     AXP  0.027618  0.031854 -0.010081 -0.016789 -0.023737  0.007930   \n",
       "0      BA  0.035912  0.036898 -0.001135  0.000000 -0.052976  0.051490   \n",
       "0     CAT  0.004667  0.021027 -0.010431 -0.029845  0.000714 -0.012649   \n",
       "..    ...       ...       ...       ...       ...       ...       ...   \n",
       "251   UNH  0.003983  0.009420 -0.000199 -0.002951 -0.004540  0.001549   \n",
       "251     V  0.000461  0.005860 -0.005630 -0.001624 -0.005324  0.004504   \n",
       "251    VZ  0.004619  0.006736 -0.001540 -0.023792 -0.005550  0.008353   \n",
       "251   WBA -0.004985  0.004985 -0.006327 -0.009983  0.003270 -0.008589   \n",
       "251   WMT -0.010298  0.002419 -0.012233 -0.003853  0.010617 -0.012910   \n",
       "\n",
       "        zd_10     zd_15     zd_20     zd_25     zd_30  \n",
       "0    0.017758  0.002323 -0.010486 -0.021578 -0.034987  \n",
       "0   -0.004266  0.001206  0.002958  0.000972 -0.002494  \n",
       "0   -0.002330  0.000971  0.011670  0.014202  0.010022  \n",
       "0    0.065741  0.083935  0.102499  0.099298  0.089213  \n",
       "0   -0.014598 -0.014490 -0.014181 -0.020199 -0.024026  \n",
       "..        ...       ...       ...       ...       ...  \n",
       "251 -0.011798 -0.019499 -0.033978 -0.050399 -0.061491  \n",
       "251 -0.003733 -0.009401 -0.020156 -0.035947 -0.042575  \n",
       "251  0.013203  0.001899 -0.004224 -0.007667 -0.008154  \n",
       "251 -0.027818 -0.036337 -0.046492 -0.064555 -0.069562  \n",
       "251 -0.024832 -0.018767 -0.026154 -0.027970 -0.024153  \n",
       "\n",
       "[7308 rows x 18 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "test = pd.read_csv(\"/home/sunshuo/qml/TradeMaster_reframe/experiment_result/data/test.csv\",index_col=0)\n",
    "test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "technical_indicator=[\"zopen\",\"zhigh\", \"zlow\", \"zadjcp\", \"zclose\", \"zd_5\", \"zd_10\",\"zd_15\", \"zd_20\", \"zd_25\", \"zd_30\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>zopen</th>\n",
       "      <th>zhigh</th>\n",
       "      <th>zlow</th>\n",
       "      <th>zadjcp</th>\n",
       "      <th>zclose</th>\n",
       "      <th>zd_5</th>\n",
       "      <th>zd_10</th>\n",
       "      <th>zd_15</th>\n",
       "      <th>zd_20</th>\n",
       "      <th>zd_25</th>\n",
       "      <th>zd_30</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.013520</td>\n",
       "      <td>0.018903</td>\n",
       "      <td>-0.013110</td>\n",
       "      <td>-0.027754</td>\n",
       "      <td>-0.011270</td>\n",
       "      <td>0.004675</td>\n",
       "      <td>0.000585</td>\n",
       "      <td>0.000279</td>\n",
       "      <td>0.000450</td>\n",
       "      <td>-0.002112</td>\n",
       "      <td>-0.005572</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.006775</td>\n",
       "      <td>0.008240</td>\n",
       "      <td>-0.013609</td>\n",
       "      <td>-0.027515</td>\n",
       "      <td>0.005160</td>\n",
       "      <td>-0.000444</td>\n",
       "      <td>-0.004146</td>\n",
       "      <td>-0.004629</td>\n",
       "      <td>-0.004932</td>\n",
       "      <td>-0.006716</td>\n",
       "      <td>-0.009717</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.011904</td>\n",
       "      <td>0.011872</td>\n",
       "      <td>-0.018804</td>\n",
       "      <td>-0.027515</td>\n",
       "      <td>0.013477</td>\n",
       "      <td>-0.010081</td>\n",
       "      <td>-0.014673</td>\n",
       "      <td>-0.015372</td>\n",
       "      <td>-0.016496</td>\n",
       "      <td>-0.017649</td>\n",
       "      <td>-0.020363</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.003480</td>\n",
       "      <td>0.010242</td>\n",
       "      <td>-0.013406</td>\n",
       "      <td>-0.027051</td>\n",
       "      <td>0.007501</td>\n",
       "      <td>-0.013490</td>\n",
       "      <td>-0.018801</td>\n",
       "      <td>-0.021310</td>\n",
       "      <td>-0.022769</td>\n",
       "      <td>-0.023511</td>\n",
       "      <td>-0.026068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.000732</td>\n",
       "      <td>0.007880</td>\n",
       "      <td>-0.011980</td>\n",
       "      <td>-0.027051</td>\n",
       "      <td>0.001537</td>\n",
       "      <td>-0.011841</td>\n",
       "      <td>-0.017192</td>\n",
       "      <td>-0.021052</td>\n",
       "      <td>-0.022886</td>\n",
       "      <td>-0.023559</td>\n",
       "      <td>-0.026377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>247</th>\n",
       "      <td>-0.007728</td>\n",
       "      <td>0.001423</td>\n",
       "      <td>-0.012106</td>\n",
       "      <td>-0.006839</td>\n",
       "      <td>0.009124</td>\n",
       "      <td>-0.015619</td>\n",
       "      <td>-0.017214</td>\n",
       "      <td>-0.018874</td>\n",
       "      <td>-0.027442</td>\n",
       "      <td>-0.027153</td>\n",
       "      <td>-0.024358</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>248</th>\n",
       "      <td>-0.003216</td>\n",
       "      <td>0.006696</td>\n",
       "      <td>-0.006475</td>\n",
       "      <td>-0.006839</td>\n",
       "      <td>0.002975</td>\n",
       "      <td>-0.010951</td>\n",
       "      <td>-0.017661</td>\n",
       "      <td>-0.019341</td>\n",
       "      <td>-0.028186</td>\n",
       "      <td>-0.028834</td>\n",
       "      <td>-0.026843</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>249</th>\n",
       "      <td>-0.001928</td>\n",
       "      <td>0.005166</td>\n",
       "      <td>-0.006219</td>\n",
       "      <td>-0.006839</td>\n",
       "      <td>0.002305</td>\n",
       "      <td>-0.008139</td>\n",
       "      <td>-0.017087</td>\n",
       "      <td>-0.019778</td>\n",
       "      <td>-0.027284</td>\n",
       "      <td>-0.029861</td>\n",
       "      <td>-0.028596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>250</th>\n",
       "      <td>0.004097</td>\n",
       "      <td>0.009604</td>\n",
       "      <td>-0.001814</td>\n",
       "      <td>-0.006839</td>\n",
       "      <td>-0.002240</td>\n",
       "      <td>-0.002522</td>\n",
       "      <td>-0.013206</td>\n",
       "      <td>-0.016015</td>\n",
       "      <td>-0.021563</td>\n",
       "      <td>-0.026838</td>\n",
       "      <td>-0.026101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>251</th>\n",
       "      <td>0.001025</td>\n",
       "      <td>0.007252</td>\n",
       "      <td>-0.003795</td>\n",
       "      <td>-0.006839</td>\n",
       "      <td>-0.001552</td>\n",
       "      <td>0.001136</td>\n",
       "      <td>-0.010333</td>\n",
       "      <td>-0.012979</td>\n",
       "      <td>-0.017388</td>\n",
       "      <td>-0.024479</td>\n",
       "      <td>-0.024071</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>252 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        zopen     zhigh      zlow    zadjcp    zclose      zd_5     zd_10  \\\n",
       "0    0.013520  0.018903 -0.013110 -0.027754 -0.011270  0.004675  0.000585   \n",
       "1   -0.006775  0.008240 -0.013609 -0.027515  0.005160 -0.000444 -0.004146   \n",
       "2   -0.011904  0.011872 -0.018804 -0.027515  0.013477 -0.010081 -0.014673   \n",
       "3   -0.003480  0.010242 -0.013406 -0.027051  0.007501 -0.013490 -0.018801   \n",
       "4    0.000732  0.007880 -0.011980 -0.027051  0.001537 -0.011841 -0.017192   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "247 -0.007728  0.001423 -0.012106 -0.006839  0.009124 -0.015619 -0.017214   \n",
       "248 -0.003216  0.006696 -0.006475 -0.006839  0.002975 -0.010951 -0.017661   \n",
       "249 -0.001928  0.005166 -0.006219 -0.006839  0.002305 -0.008139 -0.017087   \n",
       "250  0.004097  0.009604 -0.001814 -0.006839 -0.002240 -0.002522 -0.013206   \n",
       "251  0.001025  0.007252 -0.003795 -0.006839 -0.001552  0.001136 -0.010333   \n",
       "\n",
       "        zd_15     zd_20     zd_25     zd_30  \n",
       "0    0.000279  0.000450 -0.002112 -0.005572  \n",
       "1   -0.004629 -0.004932 -0.006716 -0.009717  \n",
       "2   -0.015372 -0.016496 -0.017649 -0.020363  \n",
       "3   -0.021310 -0.022769 -0.023511 -0.026068  \n",
       "4   -0.021052 -0.022886 -0.023559 -0.026377  \n",
       "..        ...       ...       ...       ...  \n",
       "247 -0.018874 -0.027442 -0.027153 -0.024358  \n",
       "248 -0.019341 -0.028186 -0.028834 -0.026843  \n",
       "249 -0.019778 -0.027284 -0.029861 -0.028596  \n",
       "250 -0.016015 -0.021563 -0.026838 -0.026101  \n",
       "251 -0.012979 -0.017388 -0.024479 -0.024071  \n",
       "\n",
       "[252 rows x 11 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_dataframe_list=[]\n",
    "for i in range(test.index.unique()[-1]+1):\n",
    "    information=test[test.index==i]\n",
    "    new_dataframe=[]\n",
    "    for tech in technical_indicator:\n",
    "        tech_value=np.mean(information[tech])\n",
    "        new_dataframe.append(tech_value)\n",
    "    all_dataframe_list.append(new_dataframe)\n",
    "new_df = pd.DataFrame(all_dataframe_list,columns=technical_indicator)    \n",
    "        \n",
    "new_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "information=test[test.index==0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "158.51826950599408"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(information[\"open\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.7.13 ('TradeMaster')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "a1f97403911abd3f02553c8f2b0c54537fddc7efadd9f5d3e31784db6e40c347"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
